package com.yqtsoft.utils.excel.core;

import com.yqtsoft.utils.excel.utils.IExcelUtil;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Sheet;

import java.util.List;

/**
 * 定义需要重写的细节
 *
 * @author: CrazyShaQiuShi
 * @email: 3105334046@qq.com
 * @date: 2018-11-25 13:07
 * @version: 1.0
 */
public abstract class AbstractExcel<T> implements IExcelUtil<T> {

    public abstract void createHeader(HSSFWorkbook wb, HSSFSheet sheet);

    public abstract void createRow(Object t, HSSFSheet sheet);

    public abstract int mergedRegio(Object t, HSSFSheet sheet, int rowStart);

    /**
     * 负责调度 将excel 数据转化为list
     *
     * @param sheet
     * @return List<?> 返回类型
     * @throws
     */
    public abstract List<T> dispatch(Sheet sheet);
}
